package com.kakarote.admin.common;

/**
 * @author zhangzhiwei
 * 模块的枚举
 */

public enum AdminModuleEnum {

    TASK_EXAMINE("taskExamine", "任务/审批"),
    CRM("crm", "客户管理"),
    LOG("log", "日志"),
    BOOK("book", "通讯录模块"),
    OA("oa", "办公模块"),
    BI("bi", "商业智能模块"),
    CALENDAR("calendar", "日历"),
    KNOWLEDGE("knowledge", "知识库"),
    EMAIL("email", "邮箱"),
    CALL("call", "呼叫中心"),
    HRM("hrm", "人力资源"),
    JXC("jxc", "进销存"),
    FINANCE("finance", "财务管理"),
    WORK("work", "项目管理"),
    MANAGE("manage", "后台管理"),
    SCRM("scrm", "SCRM"),
    ENTERPRISE("enterprise", "工商信息"),
    CS("cs", "营销管理"),
    WP("wp", "WordPress管理"),
    CUSTOM_APP("customApp", "自定义应用"),
    ;

    private AdminModuleEnum(String value, String remark) {
        this.value = value;
        this.remark = remark;
    }

    private final String value;
    private final String remark;


    public String getValue() {
        return this.value;
    }

    public String getRemark() {
        return this.remark;
    }

    public static String[] getValues() {
        String[] values = new String[values().length];
        for (int i = 0; i < values().length; i++) {
            values[i] = values()[i].getValue();
        }
        return values;
    }

    public static AdminModuleEnum parse(String module) {
        for (AdminModuleEnum adminModuleEnum : AdminModuleEnum.values()) {
            if (adminModuleEnum.getValue().equals(module)) {
                return adminModuleEnum;
            }
        }
        return null;
    }

}
